#pragma once
#include <iostream>

typedef int DataType;

class SList
{
public:
	SList(int defaultcapacity)
	{
		a = (DataType*)malloc(sizeof(DataType) * defaultcapacity);
		if (a == nullptr)
		{
			perror("malloc failed");
			return;
		}
		capacity = defaultcapacity;
		size = 0;
	}
	void PushHead(DataType x);
	void PushBack(DataType x);
	void PopHead();
	void PopBack();
	void Destroy();
	DataType Find(int num);
	
private:
	DataType* a;
	int size;
	int capacity;
};
